﻿using System;
using System.Data.Objects.DataClasses;
namespace VLUSM_DataAccess.Repositories
{
    interface IGenericRepository
    {
        void Add<TEntity>(TEntity entity) where TEntity : EntityObject;
        void Attach<TEntity>(TEntity entity) where TEntity : EntityObject;
        void Delete<TEntity>(TEntity entity) where TEntity : EntityObject;
        void Dispose();
        System.Linq.IQueryable<TEntity> Fetch<TEntity>() where TEntity : EntityObject;
        System.Collections.Generic.IEnumerable<TEntity> Find<TEntity>(Func<TEntity, bool> predicate) where TEntity : EntityObject;
        System.Collections.Generic.IEnumerable<TEntity> GetAll<TEntity>() where TEntity : EntityObject;
        TEntity GetFirst<TEntity>(Func<TEntity, bool> predicate) where TEntity : EntityObject;
        System.Collections.Generic.IEnumerable<TEntity> GetLookup<TEntity>() where TEntity : EntityObject;
        TEntity GetSingle<TEntity>(Func<TEntity, bool> predicate) where TEntity : EntityObject;
        TEntity GetSingleOrDefault<TEntity>(Func<TEntity, bool> predicate) where TEntity : EntityObject;
        void Refresh<TEntity>(System.Collections.Generic.IEnumerable<TEntity> entities) where TEntity : EntityObject;
        void Refresh<TEntity>(TEntity entity) where TEntity : EntityObject;
        void SaveChanges();
        void SaveChanges(System.Data.Objects.SaveOptions options);
    }
}
